<template>
  <div class="container" style="padding-bottom: 4rem">
    <van-nav-bar
      title="订单列表"
      left-text="返回"
      left-arrow
      @click-left="back"
    />
    <van-card
      v-for="item in Olist"
      :key="item.id"
      :num="item.details[0].amount"
      :price="item.price"
      desc="描述信息"
      :title="item.details[0].product.name"
      :thumb="item.details[0].product.coverImage"
      :thumb-link="'/#/odetail?id=' + item.id"
    />
  </div>
</template>

<script>
import { Toast } from "vant";
import { loadorder } from "../services/order";
export default {
  data() {
    return {
      Olist: {},
    };
  },
  async created() {
    const res = await loadorder();
    this.Olist = res.data;
    console.log(res.data);
  },
  methods: {
    back() {
      window.history.go(-1);
    },
    onClickButton() {
      Toast("点击按钮");
    },
  },
};
</script>

<style>
</style>